import { request } from 'umi';

// 用户登录
export async function login(params) {
  return request('/api/auth/login', {
    method: 'POST',
    data: params,
  });
}

// 刷新令牌
export async function refreshToken(params) {
  return request('/api/auth/refresh', {
    method: 'POST',
    data: params,
  });
}

// 退出登录
export async function logout() {
  return request('/api/auth/logout', {
    method: 'POST',
  });
}

// 获取当前用户权限
export async function getUserPermissions() {
  return request('/api/auth/permissions', {
    method: 'GET',
  });
}